/*
 * Copyright (C) 2009 Rafael Fernandes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.phonebooksharing.dto;

import java.io.Serializable;
import java.util.ArrayList;

public class GenericTransferDTO implements Serializable {

	private static final long serialVersionUID = 6448198304082911908L;
	public String authItem;
	public ArrayList<GenericTransferItem> items;
	public ArrayList<?> items2, items3;
	public Serializable simpleItem;
	public Long simpleID;
	public GenericTransferDTO() {
		this.items = new ArrayList<GenericTransferItem>();
	}
	
	public class GenericTransferItem implements Serializable {
		private static final long serialVersionUID = -4430239562140651660L;
		public String field1, field2, field3, field4, field5, field6, field7;
		public int id, contactID;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		for(GenericTransferItem g : items) {
			sb.append("======================\n");
			sb.append("\t\tid        = " + g.id).append("\n");
            sb.append("\t\tContactID = " + g.contactID).append("\n");
			sb.append("\t\tfield1    = " + g.field1).append("\n");
			sb.append("\t\tfield2    = " + g.field2).append("\n");
			sb.append("\t\tfield3    = " + g.field3).append("\n");
			sb.append("\t\tfield4    = " + g.field4).append("\n");
			sb.append("\t\tfield5    = " + g.field5).append("\n");
            sb.append("\t\tfield6    = " + g.field6).append("\n");
            sb.append("\t\tfield7    = " + g.field7).append("\n");
		}
		
		return "GenericTransferDTO Dump: \n" +
				"\tAuthItem [" + authItem + "]\n" +
				"\tItems\n" + 
				sb.toString();
	}
	
}
